from app.models import db


class CookiePool(db.Model):
    """Cookie池"""
    id = db.Column(db.Integer, primary_key=True)
    login_url = db.Column(db.String(80), unique=True, nullable=False)
    username = db.Column(db.String(80), unique=True, nullable=False)
    cookies = db.Column(db.String(120), unique=True, nullable=False)
    user_data_dir = db.Column(db.String(120), unique=True, nullable=False)
    create_time = db.Column(db.String(120), unique=True, nullable=False)
    update_time = db.Column(db.String(120), unique=True, nullable=False)
    create_user = db.Column(db.String(120), unique=True, nullable=False)
    update_user = db.Column(db.String(120), unique=True, nullable=False)
    expired_time = db.Column(db.String(120), unique=True, nullable=False)

    def __repr__(self):
        return f'<User {self.username}>'